SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
6 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
592 B · 15 lines tsx
Raw Blame History
1import { notFound } from "next/navigation";2import type { ReactNode } from "react";3import { api } from "@/lib/api";45/**6 * Existence gate: a 404 from the API becomes a real HTTP 404 here, before the segment's loading.tsx7 * streams a 200 shell. The page re-fetches the same URL (deduplicated by the fetch cache).8 */9export default async function OperatorLayout({ children, params }: { children: ReactNode; params: Promise<{ slug: string }> }) {10  const { slug } = await params;11  const r = await api.operator(slug);12  if (!r.ok && r.status === 404) notFound();13  return <>{children}</>;14}15